package com.ldg.user.client;

import com.ld.pojo.R;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author: Liudao
 * @Date: 2022-10-10-14:28
 * @Description:
 */
@Component
public class MyFallbackFactoryImpl implements FallbackFactory<ManagerClient> {
    @Override
    public ManagerClient create(Throwable throwable) {
        return new ManagerClient() {
            @Override
            public R findAll() {
                return R.error("fallBackFactory--->调用findAll()方法失败！");
            }

            @Override
            public R info(String id) {
                return R.error("fallBackFactory--->调用info()方法失败！");
            }
        };
    }
}
